 {

        var o = require("../UIManager/UISoundManager.js");
        cc.Class({
            extends: cc.Component,
            properties: {
                coinNum: {
                    default: null,
                    type: cc.Label
                },
                rewadBg: {
                    default: null,
                    type: cc.Sprite
                },
                title: {
                    default: null,
                    type: cc.Label
                },
                icon: {
                    default: null,
                    type: cc.Node
                },
                sign: {
                    default: null,
                    type: cc.Label
                },
                recommend: {
                    default: null,
                    type: cc.Sprite
                },
                hot: {
                    default: null,
                    type: cc.Sprite
                },
                getmore: {
                    default: null,
                    type: cc.Label
                },
                qipao: {
                    default: null,
                    type: cc.Sprite
                }
            },
            onLoad: function () {
                this.qipao.node.active = !1, this.hot.node.active = !1, this.recommend.node.active = !1;
            },
            bindData: function (e) {
                null != e ? (this._data = e, this.prodId = this._data.productId, this.prodName = this._data.displayName,
                    this.prodPrice = this._data.price + "", this.desc = this._data.desc, this.refresh(e)) : cc.error("ShopSelectItem", "bindData data = null");
            },
            onClick: function () {
                var e = this;
                o.playEffect("select"), console.log(this._data);
                var t = Global.userProfile.getHadYuanBaoNum();
                if (this._needDiamond = this._data.priceDiamond - t, this._data.chargeType == Global.config.shopType.COIN) if (t >= this._data.priceDiamond) {
                    var n = this.prodId;
                    Global.msgHandler.requestPaymentInfo(n);
                } else {
                    var i = {
                        text: "钻石不足x" + this._needDiamond,
                        confirmText: "确定",
                        confirmSp: Global.spriteAtlas.getOKSpf(),
                        cancelText: "取消",
                        cancelSp: Global.spriteAtlas.getCancelSpf(),
                        confirmCallback: function () {
                            console.log(" confirmCallback ");
                            var t = Global.configCdn.getShopConf() || Global.configCdn.getDefaultConfig("shop"),
                                n = e.getNeedChargeDiamondPayData(t), o = {
                                    prodPrice: n.price,
                                    desc: n.desc,
                                    prodId: n.productId,
                                    prodName: n.displayName
                                };
                            Global.SDK.recharge(o);
                        },
                        cancelCallback: function () {
                            console.log(" cancelCallback ");
                        }
                    };
                    Global.UIPopupManager.alert(i);
                } else {
                    var a = {
                        prodPrice: this.prodPrice,
                        desc: this.desc,
                        prodId: this.prodId,
                        prodName: this.prodName
                    };
                    Global.SDK.recharge(a);
                }
            },
            refresh: function (e) {
                var t = e.price, n = Global.utils.getNumInString(e.displayName), o = e.pic;
                this.icon.active = !1, this.sign.string = "", e.desc.indexOf("金币") >= 0 ? (n = "x" + n + "万",
                    cc.loader.load({
                        url: o,
                        type: "png"
                    }, function (e, t) {
                        try {
                            this.rewadBg.spriteFrame = new cc.SpriteFrame(t);
                        } catch (e) {
                            cc.error("ShopSelectItem ", "Error = " + e);
                        }
                    }.bind(this)), 30 == t || 68 == t ? (this.hot.node.active = !1, this.qipao.node.active = !1,
                    this.recommend.node.active = !0) : t > 68 && (this.hot.node.active = !1, this.qipao.node.active = !0,
                    this.recommend.node.active = !1)) : (n = "x" + n, Global.spriteAtlas.setSpriteFrame(this.rewadBg, "Texture/shop", o),
                    30 == t || 18 == t ? (this.hot.node.active = !1, this.qipao.node.active = !1, this.recommend.node.active = !0) : t > 30 && (this.hot.node.active = !1,
                        this.qipao.node.active = !0, this.recommend.node.active = !1)), 6 == t && (this.hot.node.active = !0,
                    this.qipao.node.active = !1, this.recommend.node.active = !1), e.bonus && (this.getmore.string = e.bonus),
                    this.sign.string = "￥", this.coinNum.string = t, this.title.string = n;
            },
            getNeedChargeDiamondPayData: function (e) {
                for (var t = [], n = [], o = this, i = {}, a = 0; a < e.diamondInfo.length; a++) {
                    var r = Global.utils.getNumInString(e.diamondInfo[a].displayName);
                    t.push(r), n = t.slice(0);
                }
                t.sort(function (e, t) {
                    return Math.abs(e - o._needDiamond) - Math.abs(t - o._needDiamond);
                });
                for (a = 0; a < n.length; a++) if (n[a] == t[0]) {
                    i = e.diamondInfo[a], console.log(i);
                    break;
                }
                return i;
            },
            start: function () {
            },
            update: function (e) {
            }
        })
    }